KEYENCE LS-3002/3004 communication driver

 

KEYENCE LS-3002/3004 communication driver is the driver to communicate with diameter instrument by laser of KEYENCE in Japan.

 

1. Read Settings

 

<Figure 1> is read setting example of KEYENCE LS-3002/3004 communication driver.

<Figure 1>  Read setting example of KEYENCE LS-3002/3004 communication driver

Device part of  <Figure 1> input Com Port(COM1), Baud Rate(1200), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively, according to controller.

Baud rate of KEYENCE LS-3002/3004 model can set as follows:

1) Open cover of front panel.

2) Please set jumper among 9 socket.

3) Baud rate according to jumper position : 75, 150, 300, 600, 1200(default), 2400, 4800, 9600, 19200bps.

 

KEYENCE LS-3002/3004 communication driver read schedule 

Read schedule setting parameters are as follows:

1) Station – Don't care.

2) Read command – Command = H, M.

H – read of status information, ( refer to <Table 1> )

M, space, ... – read of current measurement. 

3) Read start address –  Don't care.

4) Save start address for Communication Server – Saving start address of Communication Server.

5) Read Size – Fixed to 1. ( H – 5, M - 1 )

 

Read schedule example)

READ,     0,     M,     0,     0,   1,

 

<Table 1> is data saving address and contents for 'H' read command.

Data saving address Contents

Remarks

Start addr + 0 number of sample

8, 16, 32, 64, 128, 256, 512

Start addr + 1 measurement mode

1 = DIA,

2 = EDGE1,

3 = EDGE2,

4 = GAP, ¡¦

Start addr + 2 Reference Value(Standard)

5 digit integer(0 ~ 99999)

Start addr + 3 Upper Limit Value

4 digit integer(0 ~ 9999)

Start addr + 4 Lower Limit Value
<Table 1> Data saving address and contents for 'H' read command

KEYENCE LS-3002/3004 communication driver store the same data in WORD, DWORD, FLOAT memory, but the data format are different.

 

2. Writing settings

 You can read, write by using 'writing settings'. 

 

Digital Write

Digital write and analog write have the same setting parameters except output value. 

 

Analog Write 

Analog write setting parameters are as follows:

1)  PORT                   Port no. (0 ~ 255)

2)  STATION             Don't care.

3)  ADDRESS          Data saving start address when M, H write command.

4)  Extra1                  Write command.

H – read of status information, ( refer to <Table 1> )

M  – read of current measurement, 

B : stop of current measurement,

D : setting to DIA measurement mode,

E : setting to EDG1 measurement mode,

F : setting to EDG2 measurement mode,

G : setting to GAP measurement mode,

S : setting of Reference value(Standard),

U : setting of Upper Limit value,

L : setting of Lower Limit value,

MANUAL : set to Manual Operation mode,

SAMPLE : number of Sample setting. (Output value : 1 ~ 7, refer to <Table 2>) 

5) Extra2                   Don't care.

 

<Table 2> is output value and number of Sample for 'SAMPLE' write command.

Output value

Number of Sample

1

8

2

16

3

32

4

64

5

128

6

256

7

512

<Table 2> Output value and number of Sample for 'SAMPLE' write command

Write example 1)

PORT:0,  station:0, ADDRESS:0012, Extra1: M,  Extra2 : 0

The setting parameter shown above is current measurement reading example. After reading, the readed value save at 12 WORD, FLOAT, DWORD memory.

 

Write example 2)

PORT:0,  station:0, ADDRESS:0000, Extra1: D,  Extra2 : 0

The setting parameter shown above is setting example to DIA measurement mode.

 

Write example 3)

PORT:0,  station:0, ADDRESS:0000, Extra1: E,  Extra2 : 0

The setting parameter shown above is setting example to EDG1 measurement mode.

 

Write example 4)

PORT:0,  station:0, ADDRESS:0000, Extra1: SAMPLE,  Extra2 : 0, Output value = 3

The setting parameter shown above is number of Sample setting example. (setting Sampe = 32 )

 

Write example 5)

PORT:0,  station:0, ADDRESS:0000, Extra1: S,  Extra2 : 0, Output value = 12345

The setting parameter shown above is Reference value setting example. (setting value = 12.345 mm (1.2345 inch) )

 

3. Connection of RS-232C communication cable

Please connect direct RS-232C communication cable to 25 pin connector of  KEYENCE LS-3002/3004 such as <Figure 2>, <Figure 3>.

 

Computer (9 Pin connector)   KEYENCE LS-3002/3004 (25 Pin connector)

 2 Pin  ------------------------------  3 Pin

 3 Pin  ------------------------------  2 Pin

 5 Pin  ------------------------------  7 Pin

<Figure 2> Diagram of RS-232C communication cable( 9 pin connector of computer )

 

Computer (25 Pin connector)   KEYENCE LS-3002/3004 (25 Pin connector)

 2 Pin  ------------------------------  2 Pin

 3 Pin  ------------------------------  3 Pin

7 Pin  ------------------------------  7 Pin

<Figure 3> Diagram of RS-232C communication cable( 25 pin connector of computer )